load(":action.bzl", "execute")

execute(
    name = "action",
    out = "out",
    chunks = [
        "i1",
        "i2",
    ],
    cmd = select({
        "//conditions:default": "//action:do_on_linux",
        "on_linux": "//action:do_on_linux",
        "on_windows": "//action:do_on_windows",
    }),
)

sh_binary(
    name = "do_on_linux",
    srcs = ["do_on_linux.sh"],
)

sh_binary(
    name = "do_on_windows",
    srcs = ["do_on_windows.sh"],
)

config_setting(
    name = "on_linux",
    constraint_values = [
        "@platforms//os:linux",
    ],
)

config_setting(
    name = "on_windows",
    constraint_values = [
        "@platforms//os:windows",
    ],
)
